<!DOCTYPE html>




<html class="theme-next pisces" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">






  
  
  <link rel="stylesheet" media="all" href="/lib/Han/dist/han.min.css?v=3.3">




<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />



  <meta name="google-site-verification" content="9KSJHwRk-w65aBEuVrJHaNkOSgPnak9oIC4bpY7OIj8" />














  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.2" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="网络流,图论,二分图," />





  <link rel="alternate" href="/atom.xml" title="kZime's blog" type="application/atom+xml" />




  <link rel="shortcut icon" type="image/x-icon" href="/images/l.png?v=5.1.2" />






<meta name="description" content="好久之前就想搞个这个了。。    问题编号 问题名称 问题模型 转化模型 完成情况     1 飞行员配对方案问题 二分图最大匹配 网络最大流 √   2 太空飞行计划问题 最大权闭合图 网络最小割 √   3 最小路径覆盖问题 有向无环图最小路径覆盖 网络最大流    4 魔术球问题简化/普通 有向无环图最小路径覆盖 网络最大流    5 圆桌问题 二分图多重匹配 网络最大流 √   6 最长递">
<meta name="keywords" content="网络流,图论,二分图">
<meta property="og:type" content="article">
<meta property="og:title" content="[题目] 网络流和线性规划24题">
<meta property="og:url" content="http://kzime.xyz/2017/06/19/Network-flow/index.html">
<meta property="og:site_name" content="kZime&#39;s blog">
<meta property="og:description" content="好久之前就想搞个这个了。。    问题编号 问题名称 问题模型 转化模型 完成情况     1 飞行员配对方案问题 二分图最大匹配 网络最大流 √   2 太空飞行计划问题 最大权闭合图 网络最小割 √   3 最小路径覆盖问题 有向无环图最小路径覆盖 网络最大流    4 魔术球问题简化/普通 有向无环图最小路径覆盖 网络最大流    5 圆桌问题 二分图多重匹配 网络最大流 √   6 最长递">
<meta property="og:updated_time" content="2017-08-18T11:01:45.318Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="[题目] 网络流和线性规划24题">
<meta name="twitter:description" content="好久之前就想搞个这个了。。    问题编号 问题名称 问题模型 转化模型 完成情况     1 飞行员配对方案问题 二分图最大匹配 网络最大流 √   2 太空飞行计划问题 最大权闭合图 网络最小割 √   3 最小路径覆盖问题 有向无环图最小路径覆盖 网络最大流    4 魔术球问题简化/普通 有向无环图最小路径覆盖 网络最大流    5 圆桌问题 二分图多重匹配 网络最大流 √   6 最长递">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '5.1.2',
    sidebar: {"position":"left","offset":12,"offset_float":12,"b2t":true,"scrollpercent":true,"onmobile":true},
    fancybox: true,
    tabs: true,
    motion: {"enable":false,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://kzime.xyz/2017/06/19/Network-flow/"/>





  <title>[题目] 网络流和线性规划24题 | kZime's blog</title>
  




<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  ga('create', 'xxx', 'auto');
  ga('send', 'pageview');
</script>


  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?7f98f1f8c73489fb85b3d53df668e211";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">kZime's blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">kZime</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="st-search-show-outputs">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <form class="site-search-form">
  <input type="text" id="st-search-input" class="st-search-input st-default-search-input" />
</form>

<script type="text/javascript">
  (function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
    (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
    e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
  })(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');

  _st('install', 'xxx','2.0.0');
</script>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://kzime.xyz/2017/06/19/Network-flow/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="kZime">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/l.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="kZime's blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">[题目] 网络流和线性规划24题</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-06-19T15:00:43+08:00">
                2017-06-19
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/题目/" itemprop="url" rel="index">
                    <span itemprop="name">题目</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a href="/2017/06/19/Network-flow/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count disqus-comment-count"
                        data-disqus-identifier="2017/06/19/Network-flow/" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          
          

          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
                <span title="字数统计">
                  
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                <span title="阅读时长">
                  
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body han-init-context" itemprop="articleBody">

      
      

      
        <p>好久之前就想搞个这个了。。</p>
<table>
<thead>
<tr>
<th style="text-align:center">问题编号</th>
<th style="text-align:center">问题名称</th>
<th style="text-align:center">问题模型</th>
<th style="text-align:center">转化模型</th>
<th style="text-align:center">完成情况</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">1</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=14" target="_blank" rel="external">飞行员配对方案问题</a></td>
<td style="text-align:center">二分图最大匹配</td>
<td style="text-align:center">网络最大流</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/submit/code.php?id=396316" target="_blank" rel="external">√</a></td>
</tr>
<tr>
<td style="text-align:center">2</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=727" target="_blank" rel="external">太空飞行计划问题</a></td>
<td style="text-align:center">最大权闭合图</td>
<td style="text-align:center">网络最小割</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/submit/code.php?id=417385" target="_blank" rel="external">√</a></td>
</tr>
<tr>
<td style="text-align:center">3</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=728" target="_blank" rel="external">最小路径覆盖问题</a></td>
<td style="text-align:center">有向无环图最小路径覆盖</td>
<td style="text-align:center">网络最大流</td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">4</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=1302" target="_blank" rel="external">魔术球问题简化/普通</a></td>
<td style="text-align:center">有向无环图最小路径覆盖</td>
<td style="text-align:center">网络最大流</td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">5</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=729" target="_blank" rel="external">圆桌问题</a></td>
<td style="text-align:center">二分图多重匹配</td>
<td style="text-align:center">网络最大流</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/submit/code.php?id=394782" target="_blank" rel="external">√</a></td>
</tr>
<tr>
<td style="text-align:center">6</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=731" target="_blank" rel="external">最长递增子序列问题</a></td>
<td style="text-align:center">最多不相交路径</td>
<td style="text-align:center">网络最大流</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/submit/code.php?id=395947" target="_blank" rel="external">√</a></td>
</tr>
<tr>
<td style="text-align:center">7</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=732" target="_blank" rel="external">试题库问题</a></td>
<td style="text-align:center">二分图多重匹配</td>
<td style="text-align:center">网络最大流</td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">8</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=733" target="_blank" rel="external">机器人路径规划问题</a></td>
<td style="text-align:center">(未解决)</td>
<td style="text-align:center">最小费用最大流</td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">9</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=734" target="_blank" rel="external">方格取数问题</a></td>
<td style="text-align:center">二分图点权最大独立集</td>
<td style="text-align:center">网络最小割</td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">10</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=461" target="_blank" rel="external">餐巾计划问题</a></td>
<td style="text-align:center">线性规划网络优化</td>
<td style="text-align:center">最小费用最大流</td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">11</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=735" target="_blank" rel="external">航空路线问题</a></td>
<td style="text-align:center">最长不相交路径</td>
<td style="text-align:center">最小费用最大流</td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">12</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=439" target="_blank" rel="external">软件补丁问题</a></td>
<td style="text-align:center">最小转移代价</td>
<td style="text-align:center">最短路径</td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">13</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=736" target="_blank" rel="external">星际转移问题</a></td>
<td style="text-align:center">网络判定</td>
<td style="text-align:center">网络最大流</td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">14</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=44" target="_blank" rel="external">孤岛营救问题</a></td>
<td style="text-align:center">分层图最短路径</td>
<td style="text-align:center">最短路径</td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">15</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=737" target="_blank" rel="external">汽车加油行驶问题</a></td>
<td style="text-align:center">分层图最短路径</td>
<td style="text-align:center">最短路径</td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">16</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=738" target="_blank" rel="external">数字梯形问题</a></td>
<td style="text-align:center">最大权不相交路径</td>
<td style="text-align:center">最小费用最大流</td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">17</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=739" target="_blank" rel="external">运输问题</a></td>
<td style="text-align:center">网络费用流量</td>
<td style="text-align:center">最小费用最大流</td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">18</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=740" target="_blank" rel="external">分配问题</a></td>
<td style="text-align:center">二分图最佳匹配</td>
<td style="text-align:center">最小费用最大流</td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">19</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=741" target="_blank" rel="external">负载平衡问题</a></td>
<td style="text-align:center">最小代价供求</td>
<td style="text-align:center">最小费用最大流</td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">20</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=742" target="_blank" rel="external">深海机器人问题</a></td>
<td style="text-align:center">线性规划网络优化</td>
<td style="text-align:center">最小费用最大流</td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">21</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=743" target="_blank" rel="external">最长k可重区间集问题</a></td>
<td style="text-align:center">最大权不相交路径</td>
<td style="text-align:center">最小费用最大流</td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">22</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=744" target="_blank" rel="external">最长k可重线段集问题</a></td>
<td style="text-align:center">最大权不相交路径</td>
<td style="text-align:center">最小费用最大流</td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">23</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=745" target="_blank" rel="external">火星探险问题</a></td>
<td style="text-align:center">线性规划网络优化</td>
<td style="text-align:center">最小费用最大流</td>
<td style="text-align:center"></td>
</tr>
<tr>
<td style="text-align:center">24</td>
<td style="text-align:center"><a href="http://cogs.pro/cogs/problem/problem.php?pid=746" target="_blank" rel="external">骑士共存</a></td>
<td style="text-align:center">二分图最大独立集</td>
<td style="text-align:center">网络最小割</td>
</tr>
</tbody>
</table>
<p>markdown 打这个表炒鸡累啊啊啊</p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/网络流/" rel="tag"># 网络流</a>
          
            <a href="/tags/图论/" rel="tag"># 图论</a>
          
            <a href="/tags/二分图/" rel="tag"># 二分图</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/06/19/soultap/" rel="next" title="[BYVoid S1] 灵魂分流药剂">
                <i class="fa fa-chevron-left"></i> [BYVoid S1] 灵魂分流药剂
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/06/19/input/" rel="prev" title="c++读入比较">
                c++读入比较 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div id="disqus_thread">
        <noscript>
          Please enable JavaScript to view the
          <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a>
        </noscript>
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
      <div id="sidebar-dimmer"></div>
    
    <div class="sidebar-inner">

      

      

      <section class="site-overview sidebar-panel sidebar-panel-active">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          
            <img class="site-author-image" itemprop="image"
              src="/images/l.png"
              alt="kZime" />
          
            <p class="site-author-name" itemprop="name">kZime</p>
            <p class="site-description motion-element" itemprop="description">我与我仍要大战三百回合, 闲杂人等都给我退后</p>
        </div>

        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
            
              <a href="/archivesb">
            
                <span class="site-state-item-count">18</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-categories">
              <a href="/categories/index.html">
                <span class="site-state-item-count">6</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">9</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        
          <div class="feed-link motion-element">
            <a href="/atom.xml" rel="alternate">
              <i class="fa fa-rss"></i>
              RSS
            </a>
          </div>
        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://www.zhihu.com/people/shang-di-zhi-li/activities" target="_blank" title="知乎">
                  
                    <i class="fa fa-fw fa-book"></i>
                  
                    
                      知乎
                    
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://music.163.com/#/user/home?id=83525825" target="_blank" title="网易云音乐">
                  
                    <i class="fa fa-fw fa-music"></i>
                  
                    
                      网易云音乐
                    
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://github.com/yourname" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                    
                      GitHub
                    
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://twitter.com/yourname" target="_blank" title="BiliBili">
                  
                    <i class="fa fa-fw fa-television"></i>
                  
                    
                      BiliBili
                    
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://steamcommunity.com/id/979617089" target="_blank" title="Steam">
                  
                    <i class="fa fa-fw fa-steam"></i>
                  
                    
                      Steam
                    
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://t.me/kZime" target="_blank" title="Telegram">
                  
                    <i class="fa fa-fw fa-telegram"></i>
                  
                    
                      Telegram
                    
                </a>
              </span>
            
          
        </div>

        
        
          <div class="cc-license motion-element" itemprop="license">
            <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" target="_blank">
              <img src="/images/cc-by-nc-sa.svg" alt="Creative Commons" />
            </a>
          </div>
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              dalao们
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="https://blog.lcybox.com/" title="ChenYao" target="_blank">ChenYao</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://blog.xtybox.com/" title="XTT" target="_blank">XTT</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://blog.csdn.net/wmdcstdio/" title="cstdio" target="_blank">cstdio</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://fancypei.github.io/" title="Fancy" target="_blank">Fancy</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://sxysxy.org/" title="sxysxy" target="_blank">sxysxy</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://tys.design/" title="TYS" target="_blank">TYS</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://jjq0811.com/" title="JJQ" target="_blank">JJQ</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://dengspg.icoc.in/" title="DCH" target="_blank">DCH</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://justwb13.github.io/" title="WB" target="_blank">WB</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://wanzzhehe.github.io/" title="WZZ" target="_blank">WZZ</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/wahahaljy/" title="WAHAHA" target="_blank">WAHAHA</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.wingsec.win/" title="WH" target="_blank">WH</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.saruka.studio/" title="SARUKA" target="_blank">SARUKA</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://worldframe.top/" title="MCCC" target="_blank">MCCC</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://huangjiaming.com/" title="黄家面包" target="_blank">黄家面包</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://margatroid.xyz/" title="Entertainer" target="_blank">Entertainer</a>
                </li>
              
            </ul>
          </div>
        

        


      </section>

      

      
        <div class="back-to-top">
          <i class="fa fa-arrow-up"></i>
          
            <span id="scrollpercent"><span>0</span>%</span>
          
        </div>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy;  2016 &mdash; 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">kZime</span>

  
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
    
      <span class="post-meta-item-text">Site words total count&#58;</span>
    
    <span title="Site words total count">
      
    </span>
  
</div>


  <div class="powered-by">由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动</div>

  <span class="post-meta-divider">|</span>

  <div class="theme-info">主题 &mdash; <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">NexT.Pisces</a> v5.1.2</div>


        







        
      </div>
    </footer>

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  






  
  







  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>

  
  <script type="text/javascript" src="/lib/three/three.min.js"></script>

  
  <script type="text/javascript" src="/lib/three/canvas_lines.min.js"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.2"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.2"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.2"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.2"></script>



  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.2"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.2"></script>


  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.2"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.2"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.2"></script>



  


  

    
      <script id="dsq-count-scr" src="https://kZime.disqus.com/count.js" async></script>
    

    
      <script type="text/javascript">
        var disqus_config = function () {
          this.page.url = 'http://kzime.xyz/2017/06/19/Network-flow/';
          this.page.identifier = '2017/06/19/Network-flow/';
          this.page.title = '[题目] 网络流和线性规划24题';
        };
        var d = document, s = d.createElement('script');
        s.src = 'https://kZime.disqus.com/embed.js';
        s.setAttribute('data-timestamp', '' + +new Date());
        (d.head || d.body).appendChild(s);
      </script>
    

  













  

  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url);
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'auto') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });
  </script>





  

  

  

  
  


  

  

</body>
</html>
